import request from '@/utils/request'
import ConstTable from './ConstTable'


const api = {
    // 获取工作时间
    getInfo(id)
    {
        return request({
            url: `${ConstTable.BaseUrl}/BaseData/CalendarWorktime/${id}`,
            method: 'get'
        });
    },
    // 获取工作时间列表
    getList(query)
    {
        return request({
            url: `${ConstTable.BaseUrl}/BaseData/CalendarWorktime`,
            method: 'GET',
            data: query
        });
    },
    // 新建工作时间
    create(dataForm)
    {
        return request({
            url: `${ConstTable.BaseUrl}/BaseData/CalendarWorktime`,
            method: 'post',
            data: dataForm,
        });
    },
    // 更新工作时间
    update(dataForm)
    {
        return request({
            url: `${ConstTable.BaseUrl}/BaseData/CalendarWorktime/${dataForm.id}`,
            method: 'put',
            data: dataForm,
        });
    },
    // 删除工作时间
    delete(id)
    {
        return request({
            url: `${ConstTable.BaseUrl}/BaseData/CalendarWorktime/${id}`,
            method: 'delete',
        });
    },
    //导出工作时间
    exportbox(query)
    {
        return request({
            url: `${ConstTable.BaseUrl}/BaseData/CalendarWorktime/Actions/Export`,
            method: 'GET',
            data: query
        });
    }


};
export default api;
export const getWorktimeAll = api.getAll;